import QtQuick 2.15
import QtQuick.Controls 2.15
import QtMultimedia 5.15

// 导入 ImageProcessor 类
import ImageProcessor 1.0

ApplicationWindow {
    visible: true
    width: 1200
    height: 800
    title: "OpenCV and QML Example"

    // 替换自己的路径
    property string originalVideoPath : "D:/Code/qt/vot_demo/100_run.mp4"
    property string processedVideoPath: "D:/Code/qt/vot_demo/100_run.mp4"

    Row {
        width: parent.width
        height: parent.height

        // 20240401 目前只能显示一个视频，需要屏蔽另一个
        // 显示原始视频
        Video {
            id: originalVideoPlayer
            width: parent.width / 2
            height: parent.height
            source: imageProcessor0.orignVideo(originalVideoPath)
            //autoPlay: true
            fillMode: VideoOutput.Stretch
        }

        // 显示处理后的视频

        Video {
            id: processedVideoPlayer
            width: parent.width / 2
            height: parent.height / 2
            source: imageProcessor0.processVideo(processedVideoPath)
            //autoPlay: true
            fillMode: VideoOutput.Stretch
        }
    }

    ImageProcessor {
        id: imageProcessor0
    }
}
